let a = {
    "exedept_name": "内科",
    "dismed_cnt_unt": "次",
    "drug_dosform_name": null,
    "drord_endtime": "2021-08-05 11:45:01",
    "isu_dept_code": "D99",
    "drord_isu_no": "2021-08-05 11:41:00",
    "drug_used_way_code": null,
    "medn_type_code": "33084",
    "drord_type": "2",
    "medc_begntime": "2021-08-05 11:41:00",
    "DEPTCODE": "9038",
    "drord_grpno": null,
    "drord_detl_code": "33084",
    "psn_no": "BS3000049314",
    "drord_ptr_name": "蒙多",
    "drug_spec": null,
    "medc_endtime": "2021-08-05 11:41:49",
    "drug_used_idose": null,
    "tcmherb_foote": null,
    "dismed_cnt": 1,
    "exe_dept_code": "D99",
    "medn_use_frqu": "qidip",
    "mdtrt_sn": "73740",
    "mdtrt_id": "310000049105",
    "ipt_bedno": "5F45",
    "drug_used_sdose": null,
    "ipt_dept_code": "9038",
    "skintst_dicm": "0",
    "medn_type_name": null,
    "drug_dosform": null,
    "drord_chker_name": "蒙多",
    "drug_used_way": null,
    "drord_no": "4a349a5374d6458083e22a03e53798",
    "vali_flag": "1",
    "medc_days": null,
    "medcas_drord_detl_id": "73740",
    "drord_detl_name": "尿道良性肿物切除术",
    "medn_used_dosunt": null,
    "drord_item_type": "",
    "drord_item_name": "",
    "medins_orgcode": "",
    "unif_purc_drug_flag": "",
    "drug_mgt_plaf_code": "",
    "drug_purc_code": "",
    "bas_medn_flag": ""
};

let b = {
    "mdtrt_sn": "63858198",
    "mdtrt_id": "268010",
    "psn_no": "0000011304",
    "ipt_bedno": "12",
    "drord_no": "1000",
    "isu_dept_code": "1004",
    "drord_isu_no": "2021-03-18 16:03:29",
    "exe_dept_code": "1004",
    "exedept_name": "住院内科",
    "drord_chker_name": "054",
    "drord_ptr_name": null,
    "drord_grpno": null,
    "drord_type": "0",
    "drord_item_type": "1",
    "drord_item_name": "",
    "drord_detl_code": "65965082d655b5a9521bac971e7a",
    "drord_detl_name": "参苏胶囊",
    "medn_type_code": "1",
    "medn_type_name": "参苏胶囊",
    "drug_dosform": "",
    "drug_dosform_name": "",
    "drug_spec": "每粒装0.45g",
    "dismed_cnt": "5",
    "dismed_cnt_unt": "盒",
    "medn_use_frqu": null,
    "medn_used_dosunt": "片",
    "drug_used_sdose": "1",
    "drug_used_idose": "5",
    "drug_used_way_code": "132",
    "drug_used_way": "口腔吸入",
    "medc_days": "",
    "medc_begntime": "2021-03-18 16:02:00",
    "medc_endtime": "",
    "skintst_dicm": null,
    "tcmherb_foote": null,
    "drord_endtime": "",
    "ipt_dept_code": "1004",
    "medins_orgcode": "200531",
    "unif_purc_drug_flag": "1",
    "drug_mgt_plaf_code": "",
    "drug_purc_code": "",
    "bas_medn_flag": "",
    "vali_flag": "1",
    "medcas_drord_detl_id": "65965082d655b5a9521bac971e7a"
};

function compare(a, b) {
    let diffArr = [];
    for(let tmp in a) {
        if (typeof b[tmp] === "undefined") {
            diffArr.push(tmp);
        }
    }
    return diffArr;
}

console.log(compare(b, a));